package u8c.ui.mytest.panel;

import java.awt.BorderLayout;
import java.awt.HeadlessException;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;

import com.hanmanyi.web.OpenWebUrlInJava;

import nc.ui.hr.frame.FrameUI;
import nc.ui.hr.frame.MainPanel;
import nc.ui.pub.beans.UILabel;
import nc.ui.pub.beans.UIPanel;
import nc.ui.pub.beans.UITextField;
import chrriis.common.UIUtils;
import chrriis.dj.nativeswing.swtimpl.NativeInterface;
import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser;

import java.io.IOException;
import java.lang.reflect.Method;
import java.net.URISyntaxException;

public class IframePanel extends MainPanel {
	
	private static final long serialVersionUID = 1L;
	
	static {
		NativeInterface.open();
		UIUtils.setPreferredLookAndFeel();
	}
	
	BaiduTestUI frameUI = null;
//	private UIPanel mapPanel = null;
	private JWebBrowser webBrowser = null;
	public String LOCAL_ELOAM_URL = "http://www.baidu.com";
	
	
	public IframePanel(FrameUI parentUI) {
		super(parentUI);
		this.frameUI = (BaiduTestUI) parentUI;
//		this.frameUI.setSize(300, 400);
		initialize();
	}

	public void initialize() {
		SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                try {
//                	setSize(800, 600);
//                	setPreferredSize(new java.awt.Dimension(30, 30));
//                	setLayout(null);
                	BorderLayout layout = new BorderLayout();
        			setLayout(layout);
                    setVisible(true);
                    add(new OpenWebUrlInJava(LOCAL_ELOAM_URL), BorderLayout.CENTER);
            		
                } catch (HeadlessException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (URISyntaxException e) {
                    e.printStackTrace();
                }
            }
        });
	}
	
}
